package Jcat.cduestcbbs.Service;

import java.io.IOException;
import java.sql.SQLException;

import Jcat.cduestcbbs.Po.ReplyPo;
import Jcat.cduestcbbs.DaoImpl.*;

public class ReplyService {
	
	ReplyDaoImpl replyimpl = new ReplyDaoImpl();

	public boolean dealReply(ReplyPo reply) throws IOException {

		
		if (reply.getReplyContent() == null  ) {

		if (reply.getReplyContent() == null && reply.getReplyPostsId() == 0) {

			return false;
		}
		try {
			if (replyimpl.insertReply(reply) == false) {
				return false;
			} else {
				return true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}
		}
		return false;
	}

	public boolean ifLogin(String session) throws IOException {

		if (session == null) {
			return false;
		} else {
			return true;
		}
	}
}
